// store/modules/user.js (Vuex)
export default {
    namespaced: true,
    state: () => ({
      token: localStorage.getItem('token')
    }),
    mutations: {
      SET_TOKEN(state, token) {
        state.token = token
      }
    },
    actions: {
      login({ commit }, userInfo) {
        // ...登录逻辑
      }
    }
  }
  